Product Code Database
Example Keywords: data and -sail $18-187
barcode-scavenger
   » » Wiki: Unix Shell
Tag Wiki 'Unix Shell'.
Tag

A Unix shell is a shell that provides a command-line for a . A Unix shell provides a that can be used either or for writing a . A user typically works within a Unix shell via a terminal emulator; however, direct access via serial hardware connections or a are common for server systems. Although use of a Unix shell is popular with some users, others prefer to use a in a , such as those provided in desktop Linux distributions or , instead of a command-line interface (CLI).

A user may have access to multiple Unix shells with one configured to run by default when the user interactively. The default selection is typically stored in a user's profile (for example, in the local file or in a distributed configuration system such as NIS or LDAP). A user may use other shells nested inside the default shell.

A Unix shell may provide many features including: variable definition and substitution, command substitution, filename wildcarding, stream piping, (condition-testing and ), working directory context, and .


History

Early shells
The first Unix shell was the , sh, written by Ken Thompson at and distributed with Versions 1 through 6 of Unix, from 1971 to 1975. Though rudimentary by modern standards, it introduced many of the basic features common to all later Unix shells, including piping, simple control structures using if and goto, and filename GLOBbing. Though not in current use, it is still available as part of some systems, such as Version 6 Unix.

It was modeled after the shell, developed in 1965 by American software engineer . Schroeder's Multics shell was itself modeled after the program showed to the Multics Team. The "rc" suffix on some Unix configuration files (e.g. ".bashrc" or ".vimrc"), is a remnant of the RUNCOM ancestry of Unix shells.

The or Mashey shell, sh, was an upward-compatible version of the Thompson shell, augmented by and others and distributed with the Programmer's Workbench UNIX, circa 1975–1977. It focused on making shell programming practical, especially in large shared computing centers. It added shell variables (precursors of environment variables, including the search path mechanism that evolved into $PATH), user-executable shell scripts, and interrupt-handling. Control structures were extended from if/goto to if/then/else/endif, switch/breaksw/endsw, and while/end/break/continue. As shell programming became widespread, these external commands were incorporated into the shell itself for performance.

But the most widely distributed and influential of the early Unix shells were the and the . Both shells have been used as the coding base and model for many derivative and work-alike shells with extended feature sets.


Bourne shell
The , sh, was a new Unix shell by Stephen Bourne at Bell Labs. Distributed as the shell for UNIX Version 7 in 1979, it introduced the rest of the basic features considered common to all the later Unix shells, including , command substitution, more generic variables and more extensive builtin . The language, including the use of a reversed keyword to mark the end of a block, was influenced by ALGOL 68. Traditionally, the Bourne shell program name is and its path in the Unix file system hierarchy is . But a number of compatible work-alikes are also available with various improvements and additional features. On many systems, sh may be a or to one of these alternatives:

  • (ash): written as a BSD-licensed replacement for the Bourne Shell; often used in resource-constrained environments. The sh of , (and their derivatives) are based on ash that has been enhanced to be conformant.
    • : a set of Unix utilities for small and embedded systems, which includes 2 shells: ash, a derivative of the Almquist shell; and hush, an independent implementation of a Bourne shell.
    • Debian Almquist shell (dash): a modern replacement for ash in and Ubuntu
  • Bourne-Again shell (bash): written as part of the to provide a superset of Bourne Shell functionality. This shell can be found installed and is the default interactive shell for users on most systems; it provides both interactive mode (implemented by GNU Readline) or script-mode.
  • (ksh): an enhanced version of the Bourne shell, written by David Korn based on the Bourne shell sources
while working at

The standard specifies its standard shell as a strict subset of the Korn shell. From a user's perspective the Bourne shell was immediately recognized when active by its characteristic default command line prompt character, the dollar sign ().


C shell
The , csh, was modeled on the C programming language, including the control structures and the expression grammar. It was written by as a graduate student at University of California, Berkeley, and was widely distributed with BSD Unix.

The C shell also introduced many features for interactive work, including the history and editing mechanisms, aliases, directory stacks, tilde notation, cdpath, job control and path hashing. On many systems, csh may be a or to TENEX C shell (tcsh), an improved version of Joy's original version. Although the interactive features of csh have been copied to most other shells, the language structure has not been widely copied. The only work-alike is Hamilton C shell, written by Nicole Hamilton, first distributed on OS/2 in 1988 and on since 1992.


Configuration files
Shells read configuration files in various circumstances. These files usually contain commands for the shell and are executed when loaded; they are usually used to set important variables used to find executables, like $PATH, and others that control the behavior and appearance of the shell. The table in this section shows the configuration files for popular shells.

loginlogin
yesyes
loginlogin
yes
yesyes
int.
int.
(typically )int.int. int.
loginlogin
loginlogin
loginlogin loginlogin
loginlogin loginlogin
login
login
login
int.+n/login
yes
login
int.
login
login
yes
login
int.
login
login

Explanation:

  • blank means a file is not read by a shell at all.
  • "yes" means a file is always read by a shell upon startup.
  • "login" means a file is read if the shell is a login shell.
  • "n/login" means a file is read if the shell is not a login shell.
  • "int." means a file is read if the shell is interactive.


Other shells
Variations on the Unix shell concept that don't derive from Bourne shell or C shell include the following:

  • es – A functional programming rc-compatible shell written in the mid-1990s.
  • Friendly interactive shell (fish) – First released in 2005.
  • – An object-oriented shell developed originally for Windows OS and now available to macOS and Linux.
  • – A shell on the operating system based on and X/Open standards.
  • – The default shell on Plan 9 from Bell Labs and Version 10 Unix written by . Ports have been made to various operating systems.
  • – A Scheme Shell.
  • wish – A windowing shell for Tcl/Tk.


See also
Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs